<?php
$this->breadcrumbs=array(
	TextbooksModule::t('Select Campus') => Yii::app()->createUrl('/textbooks/selectUniversity'),
	TextbooksModule::t('Search Book') . ' ('.$pages->itemCount.')',
);?>

<div class="row">
	<div class="span12">
		<?php foreach ($books as $book) : ?>
		<div class="h-book-item">
			<img class="thumbnail" src="<?php if ($book->thumb) echo $book->thumb; ?>" />
			<div class="h-float-right">
				<div class="h-book-content">
					<h3><?php echo CHtml::link($book->title, array('/textbooks/book/details/book_id/'.$book->id)); ?></h3>
					<p><b>Course: <?php echo CHtml::encode($book->course->name); ?></b> - ISBN #: <?php echo CHtml::encode($book->isbn); ?></p>
					<?php if ($book->author) : ?><p>Author: <?php echo CHtml::encode($book->author); ?></p><?php endif; ?>
					<?php if ($book->phone) : ?><p>Phone Number: <?php echo CHtml::encode($book->phone); ?></p><?php endif; ?>
					<p>Post by <a href="#"><?php echo CHtml::encode($book->email); ?></a> - <?php echo date('F d, Y h:i a', $book->created); ?></p>
					<p>Description: <?php echo TextHelper::word_limiter(CHtml::encode($book->description), 30); ?></p>
				</div>
				<div class="h-price-wrap">
					<span class="h-tag-head"> </span>
					<p class="h-post-price">$<?php echo $book->price; ?></p>
				</div>
			</div>
		</div>
		<?php endforeach; ?>
		<?php if (count($books) == 0) : ?>
		<div class="well">
			There are no results
		</div>
		<?php endif; ?>
		<?php $this->widget('bootstrap.widgets.BootPager', array(
			'header' => '',
			'pages' => $pages,
			'htmlOptions' => array('class'=>'pagination h-book-item'),
		)); ?>
	</div>
</div>